FROM php:7.0.31-fpm-stretch
RUN apt-get install -y wget
RUN wget -O /etc/apt/sources.list https://mirrors.ustc.edu.cn/repogen/conf/debian-https-4-stretch
RUN apt-get update -y&&apt-get install -y zip unzip apt-utils git libfreetype6-dev   libjpeg62-turbo-dev   libmcrypt-dev  libpng-dev nginx procps
RUN docker-php-ext-install -j$(nproc) iconv mcrypt gd &&  docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/  &&docker-php-ext-install pdo_mysql mysqli

ADD ./tools/nginx.conf /etc/nginx/nginx.conf
#ADD ./tools/web/index.php /var/www/html
#ADD ./tools/conf.d/default.conf /etc/nginx/conf.d/

#vhost
RUN rm -rf /etc/nginx/sites-*
WORKDIR /etc/nginx
EXPOSE 80
CMD /usr/local/sbin/php-fpm  -D &&nginx -g 'daemon off;'

